package com.ahu.qifei.fund.common.excetpion;


import com.ahu.qifei.fund.common.enums.ResultEnum;

public class ApiException extends RuntimeException {

    private int errorCode = 500;

    public ApiException(String message) {
        super(message);
    }

    public ApiException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.errorCode = resultEnum.getCode();
    }
    public ApiException(Throwable throwable) {
        super(throwable);
    }

    public ApiException(String message, Throwable e){
        super(message,e);
    }

    public int getErrorCode() {
        return errorCode;
    }
}
